home *** CD-ROM | disk | FTP | other *** search
/ Halting the Hacker - A P…uide to Computer Security / Halting the Hacker - A Practical Guide to Computer Security.iso / rfc / rfc1832.txt < prev    next >
Text File  |  1997-04-01  |  47KB  |  1,348 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                      R. Srinivasan
  8. Request for Comments: 1832                              Sun Microsystems
  9. Category: Standards Track                                    August 1995
  10.  
  11.  
  12.                XDR: External Data Representation Standard
  13.  
  14. Status of this Memo
  15.  
  16.    This document specifies an Internet standards track protocol for the
  17.    Internet community, and requests discussion and suggestions for
  18.    improvements.  Please refer to the current edition of the "Internet
  19.    Official Protocol Standards" (STD 1) for the standardization state
  20.    and status of this protocol.  Distribution of this memo is unlimited.
  21.  
  22. ABSTRACT
  23.  
  24.    This document describes the External Data Representation Standard
  25.    (XDR) protocol as it is currently deployed and accepted.
  26.  
  27. TABLE OF CONTENTS
  28.  
  29.    1. INTRODUCTION                                              2
  30.    2. BASIC BLOCK SIZE                                          2
  31.    3. XDR DATA TYPES                                            3
  32.    3.1 Integer                                                  3
  33.    3.2 Unsigned Integer                                         4
  34.    3.3 Enumeration                                              4
  35.    3.4 Boolean                                                  4
  36.    3.5 Hyper Integer and Unsigned Hyper Integer                 4
  37.    3.6 Floating-point                                           5
  38.    3.7 Double-precision Floating-point                          6
  39.    3.8 Quadruple-precision Floating-point                       7
  40.    3.9 Fixed-length Opaque Data                                 8
  41.    3.10 Variable-length Opaque Data                             8
  42.    3.11 String                                                  9
  43.    3.12 Fixed-length Array                                     10
  44.    3.13 Variable-length Array                                  10
  45.    3.14 Structure                                              11
  46.    3.15 Discriminated Union                                    11
  47.    3.16 Void                                                   12
  48.    3.17 Constant                                               12
  49.    3.18 Typedef                                                13
  50.    3.19 Optional-data                                          14
  51.    3.20 Areas for Future Enhancement                           15
  52.    4. DISCUSSION                                               15
  53.    5. THE XDR LANGUAGE SPECIFICATION                           17
  54.    5.1 Notational Conventions                                  17
  55.  
  56.  
  57.  
  58. Srinivasan                  Standards Track                     [Page 1]
  59.  
  60. RFC 1832       XDR: External Data Representation Standard    August 1995
  61.  
  62.  
  63.    5.2 Lexical Notes                                           17
  64.    5.3 Syntax Information                                      18
  65.    5.4 Syntax Notes                                            19
  66.    6. AN EXAMPLE OF AN XDR DATA DESCRIPTION                    20
  67.    7. TRADEMARKS AND OWNERS                                    21
  68.    APPENDIX A: ANSI/IEEE Standard 754-1985                     22
  69.    APPENDIX B: REFERENCES                                      24
  70.    Security Considerations                                     24
  71.    Author's Address                                            24
  72.  
  73. 1. INTRODUCTION
  74.  
  75.    XDR is a standard for the description and encoding of data.  It is
  76.    useful for transferring data between different computer
  77.    architectures, and has been used to communicate data between such
  78.    diverse machines as the SUN WORKSTATION*, VAX*, IBM-PC*, and Cray*.
  79.    XDR fits into the ISO presentation layer, and is roughly analogous in
  80.    purpose to X.409, ISO Abstract Syntax Notation.  The major difference
  81.    between these two is that XDR uses implicit typing, while X.409 uses
  82.    explicit typing.
  83.  
  84.    XDR uses a language to describe data formats.  The language can only
  85.    be used only to describe data; it is not a programming language.
  86.    This language allows one to describe intricate data formats in a
  87.    concise manner. The alternative of using graphical representations
  88.    (itself an informal language) quickly becomes incomprehensible when
  89.    faced with complexity.  The XDR language itself is similar to the C
  90.    language [1], just as Courier [4] is similar to Mesa. Protocols such
  91.    as ONC RPC (Remote Procedure Call) and the NFS* (Network File System)
  92.    use XDR to describe the format of their data.
  93.  
  94.    The XDR standard makes the following assumption: that bytes (or
  95.    octets) are portable, where a byte is defined to be 8 bits of data.
  96.    A given hardware device should encode the bytes onto the various
  97.    media in such a way that other hardware devices may decode the bytes
  98.    without loss of meaning.  For example, the Ethernet* standard
  99.    suggests that bytes be encoded in "little-endian" style [2], or least
  100.    significant bit first.
  101.  
  102. 2. BASIC BLOCK SIZE
  103.  
  104.    The representation of all items requires a multiple of four bytes (or
  105.    32 bits) of data.  The bytes are numbered 0 through n-1.  The bytes
  106.    are read or written to some byte stream such that byte m always
  107.    precedes byte m+1.  If the n bytes needed to contain the data are not
  108.    a multiple of four, then the n bytes are followed by enough (0 to 3)
  109.    residual zero bytes, r, to make the total byte count a multiple of 4.
  110.  
  111.  
  112.  
  113.  
  114. Srinivasan                  Standards Track                     [Page 2]
  115.  
  116. RFC 1832       XDR: External Data Representation Standard    August 1995
  117.  
  118.  
  119.    We include the familiar graphic box notation for illustration and
  120.    comparison.  In most illustrations, each box (delimited by a plus
  121.    sign at the 4 corners and vertical bars and dashes) depicts a byte.
  122.    Ellipses (...) between boxes show zero or more additional bytes where
  123.    required.
  124.  
  125.         +--------+--------+...+--------+--------+...+--------+
  126.         | byte 0 | byte 1 |...|byte n-1|    0   |...|    0   |   BLOCK
  127.         +--------+--------+...+--------+--------+...+--------+
  128.         |<-----------n bytes---------->|<------r bytes------>|
  129.         |<-----------n+r (where (n+r) mod 4 = 0)>----------->|
  130.  
  131. 3. XDR DATA TYPES
  132.  
  133.    Each of the sections that follow describes a data type defined in the
  134.    XDR standard, shows how it is declared in the language, and includes
  135.    a graphic illustration of its encoding.
  136.  
  137.    For each data type in the language we show a general paradigm
  138.    declaration.  Note that angle brackets (< and >) denote
  139.    variablelength sequences of data and square brackets ([ and ]) denote
  140.    fixed-length sequences of data.  "n", "m" and "r" denote integers.
  141.    For the full language specification and more formal definitions of
  142.    terms such as "identifier" and "declaration", refer to section 5:
  143.    "The XDR Language Specification".
  144.  
  145.    For some data types, more specific examples are included.  A more
  146.    extensive example of a data description is in section 6:  "An Example
  147.    of an XDR Data Description".
  148.  
  149. 3.1 Integer
  150.  
  151.    An XDR signed integer is a 32-bit datum that encodes an integer in
  152.    the range [-2147483648,2147483647].  The integer is represented in
  153.    two's complement notation.  The most and least significant bytes are
  154.    0 and 3, respectively.  Integers are declared as follows:
  155.  
  156.          int identifier;
  157.  
  158.            (MSB)                   (LSB)
  159.          +-------+-------+-------+-------+
  160.          |byte 0 |byte 1 |byte 2 |byte 3 |                      INTEGER
  161.          +-------+-------+-------+-------+
  162.          <------------32 bits------------>
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170. Srinivasan                  Standards Track                     [Page 3]
  171.  
  172. RFC 1832       XDR: External Data Representation Standard    August 1995
  173.  
  174.  
  175. 3.2. Unsigned Integer
  176.  
  177.    An XDR unsigned integer is a 32-bit datum that encodes a nonnegative
  178.    integer in the range [0,4294967295].  It is represented by an
  179.    unsigned binary number whose most and least significant bytes are 0
  180.    and 3, respectively.  An unsigned integer is declared as follows:
  181.  
  182.          unsigned int identifier;
  183.  
  184.            (MSB)                   (LSB)
  185.             +-------+-------+-------+-------+
  186.             |byte 0 |byte 1 |byte 2 |byte 3 |             UNSIGNED INTEGER
  187.             +-------+-------+-------+-------+
  188.             <------------32 bits------------>
  189.  
  190. 3.3 Enumeration
  191.  
  192.    Enumerations have the same representation as signed integers.
  193.    Enumerations are handy for describing subsets of the integers.
  194.    Enumerated data is declared as follows:
  195.  
  196.          enum { name-identifier = constant, ... } identifier;
  197.  
  198.    For example, the three colors red, yellow, and blue could be
  199.    described by an enumerated type:
  200.  
  201.          enum { RED = 2, YELLOW = 3, BLUE = 5 } colors;
  202.  
  203.    It is an error to encode as an enum any other integer than those that
  204.    have been given assignments in the enum declaration.
  205.  
  206. 3.4 Boolean
  207.  
  208.    Booleans are important enough and occur frequently enough to warrant
  209.    their own explicit type in the standard.  Booleans are declared as
  210.    follows:
  211.  
  212.          bool identifier;
  213.  
  214.    This is equivalent to:
  215.  
  216.          enum { FALSE = 0, TRUE = 1 } identifier;
  217.  
  218. 3.5 Hyper Integer and Unsigned Hyper Integer
  219.  
  220.    The standard also defines 64-bit (8-byte) numbers called hyper
  221.    integer and unsigned hyper integer.  Their representations are the
  222.    obvious extensions of integer and unsigned integer defined above.
  223.  
  224.  
  225.  
  226. Srinivasan                  Standards Track                     [Page 4]
  227.  
  228. RFC 1832       XDR: External Data Representation Standard    August 1995
  229.  
  230.  
  231.    They are represented in two's complement notation.  The most and
  232.    least significant bytes are 0 and 7, respectively.  Their
  233.    declarations:
  234.  
  235.    hyper identifier; unsigned hyper identifier;
  236.  
  237.         (MSB)                                                   (LSB)
  238.       +-------+-------+-------+-------+-------+-------+-------+-------+
  239.       |byte 0 |byte 1 |byte 2 |byte 3 |byte 4 |byte 5 |byte 6 |byte 7 |
  240.       +-------+-------+-------+-------+-------+-------+-------+-------+
  241.       <----------------------------64 bits---------------------------->
  242.                                                  HYPER INTEGER
  243.                                                  UNSIGNED HYPER INTEGER
  244.  
  245. 3.6 Floating-point
  246.  
  247.    The standard defines the floating-point data type "float" (32 bits or
  248.    4 bytes).  The encoding used is the IEEE standard for normalized
  249.    single-precision floating-point numbers [3].  The following three
  250.    fields describe the single-precision floating-point number:
  251.  
  252.       S: The sign of the number.  Values 0 and 1 represent positive and
  253.          negative, respectively.  One bit.
  254.  
  255.       E: The exponent of the number, base 2.  8 bits are devoted to this
  256.          field.  The exponent is biased by 127.
  257.  
  258.       F: The fractional part of the number's mantissa, base 2.  23 bits
  259.          are devoted to this field.
  260.  
  261.    Therefore, the floating-point number is described by:
  262.  
  263.          (-1)**S * 2**(E-Bias) * 1.F
  264.  
  265.    It is declared as follows:
  266.  
  267.          float identifier;
  268.  
  269.          +-------+-------+-------+-------+
  270.          |byte 0 |byte 1 |byte 2 |byte 3 |              SINGLE-PRECISION
  271.          S|   E   |           F          |         FLOATING-POINT NUMBER
  272.          +-------+-------+-------+-------+
  273.          1|<- 8 ->|<-------23 bits------>|
  274.          <------------32 bits------------>
  275.  
  276.    Just as the most and least significant bytes of a number are 0 and 3,
  277.    the most and least significant bits of a single-precision floating-
  278.    point number are 0 and 31.  The beginning bit (and most significant
  279.  
  280.  
  281.  
  282. Srinivasan                  Standards Track                     [Page 5]
  283.  
  284. RFC 1832       XDR: External Data Representation Standard    August 1995
  285.  
  286.  
  287.    bit) offsets of S, E, and F are 0, 1, and 9, respectively.  Note that
  288.    these numbers refer to the mathematical positions of the bits, and
  289.    NOT to their actual physical locations (which vary from medium to
  290.    medium).
  291.  
  292.    The IEEE specifications should be consulted concerning the encoding
  293.    for signed zero, signed infinity (overflow), and denormalized numbers
  294.    (underflow) [3].  According to IEEE specifications, the "NaN" (not a
  295.    number) is system dependent and should not be interpreted within XDR
  296.    as anything other than "NaN".
  297.  
  298. 3.7 Double-precision Floating-point
  299.  
  300.    The standard defines the encoding for the double-precision floating-
  301.    point data type "double" (64 bits or 8 bytes).  The encoding used is
  302.    the IEEE standard for normalized double-precision floating-point
  303.    numbers [3].  The standard encodes the following three fields, which
  304.    describe the double-precision floating-point number:
  305.  
  306.       S: The sign of the number.  Values 0 and 1 represent positive and
  307.          negative, respectively.  One bit.
  308.  
  309.       E: The exponent of the number, base 2.  11 bits are devoted to
  310.          this field.  The exponent is biased by 1023.
  311.  
  312.       F: The fractional part of the number's mantissa, base 2.  52 bits
  313.          are devoted to this field.
  314.  
  315.    Therefore, the floating-point number is described by:
  316.  
  317.          (-1)**S * 2**(E-Bias) * 1.F
  318.  
  319.    It is declared as follows:
  320.  
  321.          double identifier;
  322.  
  323.          +------+------+------+------+------+------+------+------+
  324.          |byte 0|byte 1|byte 2|byte 3|byte 4|byte 5|byte 6|byte 7|
  325.          S|    E   |                    F                        |
  326.          +------+------+------+------+------+------+------+------+
  327.          1|<--11-->|<-----------------52 bits------------------->|
  328.          <-----------------------64 bits------------------------->
  329.                                         DOUBLE-PRECISION FLOATING-POINT
  330.  
  331.    Just as the most and least significant bytes of a number are 0 and 3,
  332.    the most and least significant bits of a double-precision floating-
  333.    point number are 0 and 63.  The beginning bit (and most significant
  334.    bit) offsets of S, E , and F are 0, 1, and 12, respectively.  Note
  335.  
  336.  
  337.  
  338. Srinivasan                  Standards Track                     [Page 6]
  339.  
  340. RFC 1832       XDR: External Data Representation Standard    August 1995
  341.  
  342.  
  343.    that these numbers refer to the mathematical positions of the bits,
  344.    and NOT to their actual physical locations (which vary from medium to
  345.    medium).
  346.  
  347.    The IEEE specifications should be consulted concerning the encoding
  348.    for signed zero, signed infinity (overflow), and denormalized numbers
  349.    (underflow) [3].  According to IEEE specifications, the "NaN" (not a
  350.    number) is system dependent and should not be interpreted within XDR
  351.    as anything other than "NaN".
  352.  
  353. 3.8 Quadruple-precision Floating-point
  354.  
  355.    The standard defines the encoding for the quadruple-precision
  356.    floating-point data type "quadruple" (128 bits or 16 bytes).  The
  357.    encoding used is designed to be a simple analog of of the encoding
  358.    used for single and double-precision floating-point numbers using one
  359.    form of IEEE double extended precision. The standard encodes the
  360.    following three fields, which describe the quadruple-precision
  361.    floating-point number:
  362.  
  363.       S: The sign of the number.  Values 0 and 1 represent positive and
  364.          negative, respectively.  One bit.
  365.  
  366.       E: The exponent of the number, base 2.  15 bits are devoted to
  367.          this field.  The exponent is biased by 16383.
  368.  
  369.       F: The fractional part of the number's mantissa, base 2.  112 bits
  370.          are devoted to this field.
  371.  
  372.    Therefore, the floating-point number is described by:
  373.  
  374.          (-1)**S * 2**(E-Bias) * 1.F
  375.  
  376.    It is declared as follows:
  377.  
  378.          quadruple identifier;
  379.  
  380.          +------+------+------+------+------+------+-...--+------+
  381.          |byte 0|byte 1|byte 2|byte 3|byte 4|byte 5| ...  |byte15|
  382.          S|    E       |                  F                      |
  383.          +------+------+------+------+------+------+-...--+------+
  384.          1|<----15---->|<-------------112 bits------------------>|
  385.          <-----------------------128 bits------------------------>
  386.                                       QUADRUPLE-PRECISION FLOATING-POINT
  387.  
  388.    Just as the most and least significant bytes of a number are 0 and 3,
  389.    the most and least significant bits of a quadruple-precision
  390.    floating-point number are 0 and 127.  The beginning bit (and most
  391.  
  392.  
  393.  
  394. Srinivasan                  Standards Track                     [Page 7]
  395.  
  396. RFC 1832       XDR: External Data Representation Standard    August 1995
  397.  
  398.  
  399.    significant bit) offsets of S, E , and F are 0, 1, and 16,
  400.    respectively.  Note that these numbers refer to the mathematical
  401.    positions of the bits, and NOT to their actual physical locations
  402.    (which vary from medium to medium).
  403.  
  404.    The encoding for signed zero, signed infinity (overflow), and
  405.    denormalized numbers are analogs of the corresponding encodings for
  406.    single and double-precision floating-point numbers [5], [6].  The
  407.    "NaN" encoding as it applies to quadruple-precision floating-point
  408.    numbers is system dependent and should not be interpreted within XDR
  409.    as anything other than "NaN".
  410.  
  411. 3.9 Fixed-length Opaque Data
  412.  
  413.    At times, fixed-length uninterpreted data needs to be passed among
  414.    machines.  This data is called "opaque" and is declared as follows:
  415.  
  416.          opaque identifier[n];
  417.  
  418.    where the constant n is the (static) number of bytes necessary to
  419.    contain the opaque data.  If n is not a multiple of four, then the n
  420.    bytes are followed by enough (0 to 3) residual zero bytes, r, to make
  421.    the total byte count of the opaque object a multiple of four.
  422.  
  423.           0        1     ...
  424.       +--------+--------+...+--------+--------+...+--------+
  425.       | byte 0 | byte 1 |...|byte n-1|    0   |...|    0   |
  426.       +--------+--------+...+--------+--------+...+--------+
  427.       |<-----------n bytes---------->|<------r bytes------>|
  428.       |<-----------n+r (where (n+r) mod 4 = 0)------------>|
  429.                                                    FIXED-LENGTH OPAQUE
  430.  
  431. 3.10 Variable-length Opaque Data
  432.  
  433.    The standard also provides for variable-length (counted) opaque data,
  434.    defined as a sequence of n (numbered 0 through n-1) arbitrary bytes
  435.    to be the number n encoded as an unsigned integer (as described
  436.    below), and followed by the n bytes of the sequence.
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450. Srinivasan                  Standards Track                     [Page 8]
  451.  
  452. RFC 1832       XDR: External Data Representation Standard    August 1995
  453.  
  454.  
  455.    Byte m of the sequence always precedes byte m+1 of the sequence, and
  456.    byte 0 of the sequence always follows the sequence's length (count).
  457.    If n is not a multiple of four, then the n bytes are followed by
  458.    enough (0 to 3) residual zero bytes, r, to make the total byte count
  459.    a multiple of four.  Variable-length opaque data is declared in the
  460.    following way:
  461.  
  462.          opaque identifier<m>;
  463.       or
  464.          opaque identifier<>;
  465.  
  466.    The constant m denotes an upper bound of the number of bytes that the
  467.    sequence may contain.  If m is not specified, as in the second
  468.    declaration, it is assumed to be (2**32) - 1, the maximum length.
  469.    The constant m would normally be found in a protocol specification.
  470.    For example, a filing protocol may state that the maximum data
  471.    transfer size is 8192 bytes, as follows:
  472.  
  473.          opaque filedata<8192>;
  474.  
  475.             0     1     2     3     4     5   ...
  476.          +-----+-----+-----+-----+-----+-----+...+-----+-----+...+-----+
  477.          |        length n       |byte0|byte1|...| n-1 |  0  |...|  0  |
  478.          +-----+-----+-----+-----+-----+-----+...+-----+-----+...+-----+
  479.          |<-------4 bytes------->|<------n bytes------>|<---r bytes--->|
  480.                                  |<----n+r (where (n+r) mod 4 = 0)---->|
  481.                                                   VARIABLE-LENGTH OPAQUE
  482.  
  483.    It is an error to encode a length greater than the maximum described
  484.    in the specification.
  485.  
  486. 3.11 String
  487.  
  488.    The standard defines a string of n (numbered 0 through n-1) ASCII
  489.    bytes to be the number n encoded as an unsigned integer (as described
  490.    above), and followed by the n bytes of the string.  Byte m of the
  491.    string always precedes byte m+1 of the string, and byte 0 of the
  492.    string always follows the string's length.  If n is not a multiple of
  493.    four, then the n bytes are followed by enough (0 to 3) residual zero
  494.    bytes, r, to make the total byte count a multiple of four.  Counted
  495.    byte strings are declared as follows:
  496.  
  497.          string object<m>;
  498.       or
  499.          string object<>;
  500.  
  501.    The constant m denotes an upper bound of the number of bytes that a
  502.    string may contain.  If m is not specified, as in the second
  503.  
  504.  
  505.  
  506. Srinivasan                  Standards Track                     [Page 9]
  507.  
  508. RFC 1832       XDR: External Data Representation Standard    August 1995
  509.  
  510.  
  511.    declaration, it is assumed to be (2**32) - 1, the maximum length.
  512.    The constant m would normally be found in a protocol specification.
  513.    For example, a filing protocol may state that a file name can be no
  514.    longer than 255 bytes, as follows:
  515.  
  516.          string filename<255>;
  517.  
  518.             0     1     2     3     4     5   ...
  519.          +-----+-----+-----+-----+-----+-----+...+-----+-----+...+-----+
  520.          |        length n       |byte0|byte1|...| n-1 |  0  |...|  0  |
  521.          +-----+-----+-----+-----+-----+-----+...+-----+-----+...+-----+
  522.          |<-------4 bytes------->|<------n bytes------>|<---r bytes--->|
  523.                                  |<----n+r (where (n+r) mod 4 = 0)---->|
  524.                                                                   STRING
  525.  
  526.    It is an error to encode a length greater than the maximum described
  527.    in the specification.
  528.  
  529. 3.12 Fixed-length Array
  530.  
  531.    Declarations for fixed-length arrays of homogeneous elements are in
  532.    the following form:
  533.  
  534.          type-name identifier[n];
  535.  
  536.    Fixed-length arrays of elements numbered 0 through n-1 are encoded by
  537.    individually encoding the elements of the array in their natural
  538.    order, 0 through n-1.  Each element's size is a multiple of four
  539.    bytes. Though all elements are of the same type, the elements may
  540.    have different sizes.  For example, in a fixed-length array of
  541.    strings, all elements are of type "string", yet each element will
  542.    vary in its length.
  543.  
  544.          +---+---+---+---+---+---+---+---+...+---+---+---+---+
  545.          |   element 0   |   element 1   |...|  element n-1  |
  546.          +---+---+---+---+---+---+---+---+...+---+---+---+---+
  547.          |<--------------------n elements------------------->|
  548.  
  549.                                                FIXED-LENGTH ARRAY
  550.  
  551. 3.13 Variable-length Array
  552.  
  553. Counted arrays provide the ability to encode variable-length arrays of
  554. homogeneous elements.  The array is encoded as the element count n (an
  555. unsigned integer) followed by the encoding of each of the array's
  556. elements, starting with element 0 and progressing through element n- 1.
  557. The declaration for variable-length arrays follows this form:
  558.  
  559.  
  560.  
  561.  
  562. Srinivasan                  Standards Track                    [Page 10]
  563.  
  564. RFC 1832       XDR: External Data Representation Standard    August 1995
  565.  
  566.  
  567.          type-name identifier<m>;
  568.       or
  569.          type-name identifier<>;
  570.  
  571.    The constant m specifies the maximum acceptable element count of an
  572.    array; if m is not specified, as in the second declaration, it is
  573.    assumed to be (2**32) - 1.
  574.  
  575.            0  1  2  3
  576.          +--+--+--+--+--+--+--+--+--+--+--+--+...+--+--+--+--+
  577.          |     n     | element 0 | element 1 |...|element n-1|
  578.          +--+--+--+--+--+--+--+--+--+--+--+--+...+--+--+--+--+
  579.          |<-4 bytes->|<--------------n elements------------->|
  580.                                                          COUNTED ARRAY
  581.  
  582.    It is an error to encode a value of n that is greater than the
  583.    maximum described in the specification.
  584.  
  585. 3.14 Structure
  586.  
  587.    Structures are declared as follows:
  588.  
  589.          struct {
  590.             component-declaration-A;
  591.             component-declaration-B;
  592.             ...
  593.          } identifier;
  594.  
  595.    The components of the structure are encoded in the order of their
  596.    declaration in the structure.  Each component's size is a multiple of
  597.    four bytes, though the components may be different sizes.
  598.  
  599.          +-------------+-------------+...
  600.          | component A | component B |...                      STRUCTURE
  601.          +-------------+-------------+...
  602.  
  603. 3.15 Discriminated Union
  604.  
  605.    A discriminated union is a type composed of a discriminant followed
  606.    by a type selected from a set of prearranged types according to the
  607.    value of the discriminant.  The type of discriminant is either "int",
  608.    "unsigned int", or an enumerated type, such as "bool".  The component
  609.    types are called "arms" of the union, and are preceded by the value
  610.    of the discriminant which implies their encoding.  Discriminated
  611.    unions are declared as follows:
  612.  
  613.          union switch (discriminant-declaration) {
  614.          case discriminant-value-A:
  615.  
  616.  
  617.  
  618. Srinivasan                  Standards Track                    [Page 11]
  619.  
  620. RFC 1832       XDR: External Data Representation Standard    August 1995
  621.  
  622.  
  623.             arm-declaration-A;
  624.          case discriminant-value-B:
  625.             arm-declaration-B;
  626.          ...
  627.          default: default-declaration;
  628.          } identifier;
  629.  
  630.    Each "case" keyword is followed by a legal value of the discriminant.
  631.    The default arm is optional.  If it is not specified, then a valid
  632.    encoding of the union cannot take on unspecified discriminant values.
  633.    The size of the implied arm is always a multiple of four bytes.
  634.  
  635.    The discriminated union is encoded as its discriminant followed by
  636.    the encoding of the implied arm.
  637.  
  638.            0   1   2   3
  639.          +---+---+---+---+---+---+---+---+
  640.          |  discriminant |  implied arm  |          DISCRIMINATED UNION
  641.          +---+---+---+---+---+---+---+---+
  642.          |<---4 bytes--->|
  643.  
  644. 3.16 Void
  645.  
  646.    An XDR void is a 0-byte quantity.  Voids are useful for describing
  647.    operations that take no data as input or no data as output. They are
  648.    also useful in unions, where some arms may contain data and others do
  649.    not.  The declaration is simply as follows:
  650.  
  651.          void;
  652.  
  653.    Voids are illustrated as follows:
  654.  
  655.            ++
  656.            ||                                                     VOID
  657.            ++
  658.          --><-- 0 bytes
  659.  
  660. 3.17 Constant
  661.  
  662.    The data declaration for a constant follows this form:
  663.  
  664.          const name-identifier = n;
  665.  
  666.    "const" is used to define a symbolic name for a constant; it does not
  667.    declare any data.  The symbolic constant may be used anywhere a
  668.    regular constant may be used.  For example, the following defines a
  669.    symbolic constant DOZEN, equal to 12.
  670.  
  671.  
  672.  
  673.  
  674. Srinivasan                  Standards Track                    [Page 12]
  675.  
  676. RFC 1832       XDR: External Data Representation Standard    August 1995
  677.  
  678.  
  679.          const DOZEN = 12;
  680.  
  681. 3.18 Typedef
  682.  
  683.    "typedef" does not declare any data either, but serves to define new
  684.    identifiers for declaring data. The syntax is:
  685.  
  686.          typedef declaration;
  687.  
  688.    The new type name is actually the variable name in the declaration
  689.    part of the typedef.  For example, the following defines a new type
  690.    called "eggbox" using an existing type called "egg":
  691.  
  692.          typedef egg eggbox[DOZEN];
  693.  
  694.    Variables declared using the new type name have the same type as the
  695.    new type name would have in the typedef, if it was considered a
  696.    variable.  For example, the following two declarations are equivalent
  697.    in declaring the variable "fresheggs":
  698.  
  699.          eggbox  fresheggs; egg     fresheggs[DOZEN];
  700.  
  701.    When a typedef involves a struct, enum, or union definition, there is
  702.    another (preferred) syntax that may be used to define the same type.
  703.    In general, a typedef of the following form:
  704.  
  705.          typedef <<struct, union, or enum definition>> identifier;
  706.  
  707.    may be converted to the alternative form by removing the "typedef"
  708.    part and placing the identifier after the "struct", "union", or
  709.    "enum" keyword, instead of at the end.  For example, here are the two
  710.    ways to define the type "bool":
  711.  
  712.          typedef enum {    /* using typedef */
  713.             FALSE = 0,
  714.             TRUE = 1
  715.          } bool;
  716.  
  717.          enum bool {       /* preferred alternative */
  718.             FALSE = 0,
  719.             TRUE = 1
  720.          };
  721.  
  722.    The reason this syntax is preferred is one does not have to wait
  723.    until the end of a declaration to figure out the name of the new
  724.    type.
  725.  
  726.  
  727.  
  728.  
  729.  
  730. Srinivasan                  Standards Track                    [Page 13]
  731.  
  732. RFC 1832       XDR: External Data Representation Standard    August 1995
  733.  
  734.  
  735. 3.19 Optional-data
  736.  
  737.    Optional-data is one kind of union that occurs so frequently that we
  738.    give it a special syntax of its own for declaring it.  It is declared
  739.    as follows:
  740.  
  741.          type-name *identifier;
  742.  
  743.    This is equivalent to the following union:
  744.  
  745.          union switch (bool opted) {
  746.          case TRUE:
  747.             type-name element;
  748.          case FALSE:
  749.             void;
  750.          } identifier;
  751.  
  752.    It is also equivalent to the following variable-length array
  753.    declaration, since the boolean "opted" can be interpreted as the
  754.    length of the array:
  755.  
  756.          type-name identifier<1>;
  757.  
  758.    Optional-data is not so interesting in itself, but it is very useful
  759.    for describing recursive data-structures such as linked-lists and
  760.    trees.  For example, the following defines a type "stringlist" that
  761.    encodes lists of arbitrary length strings:
  762.  
  763.          struct *stringlist {
  764.             string item<>;
  765.             stringlist next;
  766.          };
  767.  
  768.    It could have been equivalently declared as the following union:
  769.  
  770.          union stringlist switch (bool opted) {
  771.          case TRUE:
  772.             struct {
  773.                string item<>;
  774.                stringlist next;
  775.             } element;
  776.          case FALSE:
  777.             void;
  778.          };
  779.  
  780.    or as a variable-length array:
  781.  
  782.          struct stringlist<1> {
  783.  
  784.  
  785.  
  786. Srinivasan                  Standards Track                    [Page 14]
  787.  
  788. RFC 1832       XDR: External Data Representation Standard    August 1995
  789.  
  790.  
  791.             string item<>;
  792.             stringlist next;
  793.          };
  794.  
  795.    Both of these declarations obscure the intention of the stringlist
  796.    type, so the optional-data declaration is preferred over both of
  797.    them.  The optional-data type also has a close correlation to how
  798.    recursive data structures are represented in high-level languages
  799.    such as Pascal or C by use of pointers. In fact, the syntax is the
  800.    same as that of the C language for pointers.
  801.  
  802. 3.20 Areas for Future Enhancement
  803.  
  804.    The XDR standard lacks representations for bit fields and bitmaps,
  805.    since the standard is based on bytes.  Also missing are packed (or
  806.    binary-coded) decimals.
  807.  
  808.    The intent of the XDR standard was not to describe every kind of data
  809.    that people have ever sent or will ever want to send from machine to
  810.    machine. Rather, it only describes the most commonly used data-types
  811.    of high-level languages such as Pascal or C so that applications
  812.    written in these languages will be able to communicate easily over
  813.    some medium.
  814.  
  815.    One could imagine extensions to XDR that would let it describe almost
  816.    any existing protocol, such as TCP.  The minimum necessary for this
  817.    are support for different block sizes and byte-orders.  The XDR
  818.    discussed here could then be considered the 4-byte big-endian member
  819.    of a larger XDR family.
  820.  
  821. 4. DISCUSSION
  822.  
  823.    (1) Why use a language for describing data?  What's wrong with
  824.    diagrams?
  825.  
  826.    There are many advantages in using a data-description language such
  827.    as XDR versus using diagrams.  Languages are more formal than
  828.    diagrams and lead to less ambiguous descriptions of data.  Languages
  829.    are also easier to understand and allow one to think of other issues
  830.    instead of the low-level details of bit-encoding.  Also, there is a
  831.    close analogy between the types of XDR and a high-level language such
  832.    as C or Pascal.  This makes the implementation of XDR encoding and
  833.    decoding modules an easier task.  Finally, the language specification
  834.    itself is an ASCII string that can be passed from machine to machine
  835.    to perform on-the-fly data interpretation.
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842. Srinivasan                  Standards Track                    [Page 15]
  843.  
  844. RFC 1832       XDR: External Data Representation Standard    August 1995
  845.  
  846.  
  847.    (2) Why is there only one byte-order for an XDR unit?
  848.  
  849.    Supporting two byte-orderings requires a higher level protocol for
  850.    determining in which byte-order the data is encoded.  Since XDR is
  851.    not a protocol, this can't be done.  The advantage of this, though,
  852.    is that data in XDR format can be written to a magnetic tape, for
  853.    example, and any machine will be able to interpret it, since no
  854.    higher level protocol is necessary for determining the byte-order.
  855.  
  856.    (3) Why is the XDR byte-order big-endian instead of little-endian?
  857.    Isn't this unfair to little-endian machines such as the VAX(r), which
  858.    has to convert from one form to the other?
  859.  
  860.    Yes, it is unfair, but having only one byte-order means you have to
  861.    be unfair to somebody.  Many architectures, such as the Motorola
  862.    68000* and IBM 370*, support the big-endian byte-order.
  863.  
  864.    (4) Why is the XDR unit four bytes wide?
  865.  
  866.    There is a tradeoff in choosing the XDR unit size.  Choosing a small
  867.    size such as two makes the encoded data small, but causes alignment
  868.    problems for machines that aren't aligned on these boundaries.  A
  869.    large size such as eight means the data will be aligned on virtually
  870.    every machine, but causes the encoded data to grow too big.  We chose
  871.    four as a compromise.  Four is big enough to support most
  872.    architectures efficiently, except for rare machines such as the
  873.    eight-byte aligned Cray*.  Four is also small enough to keep the
  874.    encoded data restricted to a reasonable size.
  875.  
  876.    (5) Why must variable-length data be padded with zeros?
  877.  
  878.    It is desirable that the same data encode into the same thing on all
  879.    machines, so that encoded data can be meaningfully compared or
  880.    checksummed.  Forcing the padded bytes to be zero ensures this.
  881.  
  882.    (6) Why is there no explicit data-typing?
  883.  
  884.    Data-typing has a relatively high cost for what small advantages it
  885.    may have.  One cost is the expansion of data due to the inserted type
  886.    fields.  Another is the added cost of interpreting these type fields
  887.    and acting accordingly.  And most protocols already know what type
  888.    they expect, so data-typing supplies only redundant information.
  889.    However, one can still get the benefits of data-typing using XDR. One
  890.    way is to encode two things: first a string which is the XDR data
  891.    description of the encoded data, and then the encoded data itself.
  892.    Another way is to assign a value to all the types in XDR, and then
  893.    define a universal type which takes this value as its discriminant
  894.    and for each value, describes the corresponding data type.
  895.  
  896.  
  897.  
  898. Srinivasan                  Standards Track                    [Page 16]
  899.  
  900. RFC 1832       XDR: External Data Representation Standard    August 1995
  901.  
  902.  
  903. 5. THE XDR LANGUAGE SPECIFICATION
  904.  
  905. 5.1 Notational Conventions
  906.  
  907.    This specification uses an extended Back-Naur Form notation for
  908.    describing the XDR language.  Here is a brief description of the
  909.     notation:
  910.  
  911.    (1) The characters '|', '(', ')', '[', ']', '"', and '*' are special.
  912.    (2) Terminal symbols are strings of any characters surrounded by
  913.    double quotes.  (3) Non-terminal symbols are strings of non-special
  914.    characters.  (4) Alternative items are separated by a vertical bar
  915.    ("|").  (5) Optional items are enclosed in brackets.  (6) Items are
  916.    grouped together by enclosing them in parentheses.  (7) A '*'
  917.    following an item means 0 or more occurrences of that item.
  918.  
  919.    For example,  consider  the  following pattern:
  920.  
  921.          "a " "very" (", " "very")* [" cold " "and "]  " rainy "
  922.          ("day" | "night")
  923.  
  924.    An infinite number of strings match this pattern. A few of them are:
  925.  
  926.          "a very rainy day"
  927.          "a very, very rainy day"
  928.          "a very cold and  rainy day"
  929.          "a very, very, very cold and  rainy night"
  930.  
  931. 5.2 Lexical Notes
  932.  
  933.    (1) Comments begin with '/*' and terminate with '*/'.  (2) White
  934.    space serves to separate items and is otherwise ignored.  (3) An
  935.    identifier is a letter followed by an optional sequence of letters,
  936.    digits or underbar ('_'). The case of identifiers is not ignored.
  937.    (4) A constant is a sequence of one or more decimal digits,
  938.    optionally preceded by a minus-sign ('-').
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954. Srinivasan                  Standards Track                    [Page 17]
  955.  
  956. RFC 1832       XDR: External Data Representation Standard    August 1995
  957.  
  958.  
  959. 5.3 Syntax Information
  960.  
  961.       declaration:
  962.            type-specifier identifier
  963.          | type-specifier identifier "[" value "]"
  964.          | type-specifier identifier "<" [ value ] ">"
  965.          | "opaque" identifier "[" value "]"
  966.          | "opaque" identifier "<" [ value ] ">"
  967.          | "string" identifier "<" [ value ] ">"
  968.          | type-specifier "*" identifier
  969.          | "void"
  970.  
  971.       value:
  972.            constant
  973.          | identifier
  974.  
  975.       type-specifier:
  976.            [ "unsigned" ] "int"
  977.          | [ "unsigned" ] "hyper"
  978.          | "float"
  979.          | "double"
  980.          | "quadruple"
  981.          | "bool"
  982.          | enum-type-spec
  983.          | struct-type-spec
  984.          | union-type-spec
  985.          | identifier
  986.  
  987.       enum-type-spec:
  988.          "enum" enum-body
  989.  
  990.       enum-body:
  991.          "{"
  992.             ( identifier "=" value )
  993.             ( "," identifier "=" value )*
  994.          "}"
  995.  
  996.       struct-type-spec:
  997.          "struct" struct-body
  998.  
  999.       struct-body:
  1000.          "{"
  1001.             ( declaration ";" )
  1002.             ( declaration ";" )*
  1003.          "}"
  1004.  
  1005.       union-type-spec:
  1006.          "union" union-body
  1007.  
  1008.  
  1009.  
  1010. Srinivasan                  Standards Track                    [Page 18]
  1011.  
  1012. RFC 1832       XDR: External Data Representation Standard    August 1995
  1013.  
  1014.  
  1015.       union-body:
  1016.          "switch" "(" declaration ")" "{"
  1017.             ( "case" value ":" declaration ";" )
  1018.             ( "case" value ":" declaration ";" )*
  1019.             [ "default" ":" declaration ";" ]
  1020.          "}"
  1021.  
  1022.       constant-def:
  1023.          "const" identifier "=" constant ";"
  1024.  
  1025.       type-def:
  1026.            "typedef" declaration ";"
  1027.          | "enum" identifier enum-body ";"
  1028.          | "struct" identifier struct-body ";"
  1029.          | "union" identifier union-body ";"
  1030.  
  1031.       definition:
  1032.            type-def
  1033.          | constant-def
  1034.  
  1035.       specification:
  1036.            definition *
  1037.  
  1038. 5.4 Syntax Notes
  1039.  
  1040.    (1) The following are keywords and cannot be used as identifiers:
  1041.    "bool", "case", "const", "default", "double", "quadruple", "enum",
  1042.    "float", "hyper", "opaque", "string", "struct", "switch", "typedef",
  1043.    "union", "unsigned" and "void".
  1044.  
  1045.    (2) Only unsigned constants may be used as size specifications for
  1046.    arrays.  If an identifier is used, it must have been declared
  1047.    previously as an unsigned constant in a "const" definition.
  1048.  
  1049.    (3) Constant and type identifiers within the scope of a specification
  1050.    are in the same name space and must be declared uniquely within this
  1051.    scope.
  1052.  
  1053.    (4) Similarly, variable names must be unique within the scope of
  1054.    struct and union declarations. Nested struct and union declarations
  1055.    create new scopes.
  1056.  
  1057.    (5) The discriminant of a union must be of a type that evaluates to
  1058.    an integer. That is, "int", "unsigned int", "bool", an enumerated
  1059.    type or any typedefed type that evaluates to one of these is legal.
  1060.    Also, the case values must be one of the legal values of the
  1061.    discriminant.  Finally, a case value may not be specified more than
  1062.    once within the scope of a union declaration.
  1063.  
  1064.  
  1065.  
  1066. Srinivasan                  Standards Track                    [Page 19]
  1067.  
  1068. RFC 1832       XDR: External Data Representation Standard    August 1995
  1069.  
  1070.  
  1071. 6. AN EXAMPLE OF AN XDR DATA DESCRIPTION
  1072.  
  1073.    Here is a short XDR data description of a thing called a "file",
  1074.    which might be used to transfer files from one machine to another.
  1075.  
  1076.          const MAXUSERNAME = 32;     /* max length of a user name */
  1077.          const MAXFILELEN = 65535;   /* max length of a file      */
  1078.          const MAXNAMELEN = 255;     /* max length of a file name */
  1079.  
  1080.          /*
  1081.           * Types of files:
  1082.           */
  1083.          enum filekind {
  1084.             TEXT = 0,       /* ascii data */
  1085.             DATA = 1,       /* raw data   */
  1086.             EXEC = 2        /* executable */
  1087.          };
  1088.  
  1089.          /*
  1090.           * File information, per kind of file:
  1091.           */
  1092.          union filetype switch (filekind kind) {
  1093.          case TEXT:
  1094.             void;                           /* no extra information */
  1095.          case DATA:
  1096.             string creator<MAXNAMELEN>;     /* data creator         */
  1097.          case EXEC:
  1098.             string interpretor<MAXNAMELEN>; /* program interpretor  */
  1099.          };
  1100.  
  1101.          /*
  1102.           * A complete file:
  1103.           */
  1104.          struct file {
  1105.             string filename<MAXNAMELEN>; /* name of file    */
  1106.             filetype type;               /* info about file */
  1107.             string owner<MAXUSERNAME>;   /* owner of file   */
  1108.             opaque data<MAXFILELEN>;     /* file data       */
  1109.          };
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122. Srinivasan                  Standards Track                    [Page 20]
  1123.  
  1124. RFC 1832       XDR: External Data Representation Standard    August 1995
  1125.  
  1126.  
  1127.    Suppose now that there is a user named "john" who wants to store his
  1128.    lisp program "sillyprog" that contains just the data "(quit)".  His
  1129.    file would be encoded as follows:
  1130.  
  1131.        OFFSET  HEX BYTES       ASCII    COMMENTS
  1132.        ------  ---------       -----    --------
  1133.         0      00 00 00 09     ....     -- length of filename = 9
  1134.         4      73 69 6c 6c     sill     -- filename characters
  1135.         8      79 70 72 6f     ypro     -- ... and more characters ...
  1136.        12      67 00 00 00     g...     -- ... and 3 zero-bytes of fill
  1137.        16      00 00 00 02     ....     -- filekind is EXEC = 2
  1138.        20      00 00 00 04     ....     -- length of interpretor = 4
  1139.        24      6c 69 73 70     lisp     -- interpretor characters
  1140.        28      00 00 00 04     ....     -- length of owner = 4
  1141.        32      6a 6f 68 6e     john     -- owner characters
  1142.        36      00 00 00 06     ....     -- length of file data = 6
  1143.        40      28 71 75 69     (qui     -- file data bytes ...
  1144.        44      74 29 00 00     t)..     -- ... and 2 zero-bytes of fill
  1145.  
  1146. 7. TRADEMARKS AND OWNERS
  1147.  
  1148.          SUN WORKSTATION  Sun Microsystems, Inc.
  1149.          VAX              Digital Equipment Corporation
  1150.          IBM-PC           International Business Machines Corporation
  1151.          Cray             Cray Research
  1152.          NFS              Sun Microsystems, Inc.
  1153.          Ethernet         Xerox Corporation.
  1154.          Motorola 68000   Motorola, Inc.
  1155.          IBM 370          International Business Machines Corporation
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178. Srinivasan                  Standards Track                    [Page 21]
  1179.  
  1180. RFC 1832       XDR: External Data Representation Standard    August 1995
  1181.  
  1182.  
  1183. APPENDIX A: ANSI/IEEE Standard 754-1985
  1184.  
  1185.    The definition of NaNs, signed zero and infinity, and denormalized
  1186.    numbers from [3] is reproduced here for convenience.  The definitions
  1187.    for quadruple-precision floating point numbers are analogs of those
  1188.    for single and double-precision floating point numbers, and are
  1189.    defined in [3].
  1190.  
  1191.    In the following, 'S' stands for the sign bit, 'E' for the exponent,
  1192.    and 'F' for the fractional part.  The symbol 'u' stands for an
  1193.    undefined bit (0 or 1).
  1194.  
  1195.    For single-precision floating point numbers:
  1196.  
  1197.     Type                  S (1 bit)   E (8 bits)    F (23 bits)
  1198.     ----                  ---------   ----------    -----------
  1199.     signalling NaN        u           255 (max)     .0uuuuu---u
  1200.                                                     (with at least
  1201.                                                      one 1 bit)
  1202.     quiet NaN             u           255 (max)     .1uuuuu---u
  1203.  
  1204.     negative infinity     1           255 (max)     .000000---0
  1205.  
  1206.     positive infinity     0           255 (max)     .000000---0
  1207.  
  1208.     negative zero         1           0             .000000---0
  1209.  
  1210.     positive zero         0           0             .000000---0
  1211.  
  1212. For double-precision floating point numbers:
  1213.  
  1214.     Type                  S (1 bit)   E (11 bits)   F (52 bits)
  1215.     ----                  ---------   -----------   -----------
  1216.     signalling NaN        u           2047 (max)    .0uuuuu---u
  1217.                                                     (with at least
  1218.                                                      one 1 bit)
  1219.     quiet NaN             u           2047 (max)    .1uuuuu---u
  1220.  
  1221.     negative infinity     1           2047 (max)    .000000---0
  1222.  
  1223.     positive infinity     0           2047 (max)    .000000---0
  1224.  
  1225.     negative zero         1           0             .000000---0
  1226.  
  1227.     positive zero         0           0             .000000---0
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234. Srinivasan                  Standards Track                    [Page 22]
  1235.  
  1236. RFC 1832       XDR: External Data Representation Standard    August 1995
  1237.  
  1238.  
  1239. For quadruple-precision floating point numbers:
  1240.  
  1241.     Type                  S (1 bit)   E (15 bits)   F (112 bits)
  1242.     ----                  ---------   -----------   ------------
  1243.     signalling NaN        u           32767 (max)   .0uuuuu---u
  1244.                                                     (with at least
  1245.                                                      one 1 bit)
  1246.     quiet NaN             u           32767 (max)   .1uuuuu---u
  1247.  
  1248.     negative infinity     1           32767 (max)   .000000---0
  1249.  
  1250.     positive infinity     0           32767 (max)   .000000---0
  1251.  
  1252.     negative zero         1           0             .000000---0
  1253.  
  1254.     positive zero         0           0             .000000---0
  1255.  
  1256. Subnormal numbers are represented as follows:
  1257.  
  1258.     Precision            Exponent       Value
  1259.     ---------            --------       -----
  1260.     Single               0              (-1)**S * 2**(-126) * 0.F
  1261.  
  1262.     Double               0              (-1)**S * 2**(-1022) * 0.F
  1263.  
  1264.     Quadruple            0              (-1)**S * 2**(-16382) * 0.F
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290. Srinivasan                  Standards Track                    [Page 23]
  1291.  
  1292. RFC 1832       XDR: External Data Representation Standard    August 1995
  1293.  
  1294.  
  1295. APPENDIX B: REFERENCES
  1296.  
  1297.    [1]  Brian W. Kernighan & Dennis M. Ritchie, "The C Programming
  1298.         Language", Bell Laboratories, Murray Hill, New Jersey, 1978.
  1299.  
  1300.    [2]  Danny Cohen, "On Holy Wars and a Plea for Peace", IEEE Computer,
  1301.         October 1981.
  1302.  
  1303.    [3]  "IEEE Standard for Binary Floating-Point Arithmetic", ANSI/IEEE
  1304.         Standard 754-1985, Institute of Electrical and Electronics
  1305.         Engineers, August 1985.
  1306.  
  1307.    [4]  "Courier: The Remote Procedure Call Protocol", XEROX
  1308.         Corporation, XSIS 038112, December 1981.
  1309.  
  1310.    [5]  "The SPARC Architecture Manual: Version 8", Prentice Hall,
  1311.         ISBN 0-13-825001-4.
  1312.  
  1313.    [6]  "HP Precision Architecture Handbook", June 1987, 5954-9906.
  1314.  
  1315.    [7]  Srinivasan, R., "Remote Procedure Call Protocol Version 2",
  1316.         RFC 1831, Sun Microsystems, Inc., August 1995.
  1317.  
  1318. Security Considerations
  1319.  
  1320.    Security issues are not discussed in this memo.
  1321.  
  1322. Author's Address
  1323.  
  1324.    Raj Srinivasan
  1325.    Sun Microsystems, Inc.
  1326.    ONC Technologies
  1327.    2550 Garcia Avenue
  1328.    M/S MTV-5-40
  1329.    Mountain View, CA  94043
  1330.    USA
  1331.  
  1332.    Phone: 415-336-2478
  1333.    Fax:   415-336-6015
  1334.    EMail: raj@eng.sun.com
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346. Srinivasan                  Standards Track                    [Page 24]
  1347.  
  1348.